package com.igeek.compus.backend.singleton;

import java.util.Properties;

public class DbConfig {

    private Properties properties;

    private static DbConfig dbConfig = null;

    private DbConfig() {
        try {
            properties = new Properties();
            properties.load(this.getClass().getClassLoader().getResourceAsStream("db.properties"));
        }catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static DbConfig getInstance() {
        if(dbConfig == null) {
            dbConfig = new DbConfig();
        }
        return dbConfig;
    }

    public String getProperty(String key) {
        return properties.getProperty(key);
    }
}
